#/usr/bin/python
# coding: utf8

import sys
import time
import win32api
import win32con


reload(sys)
sys.setdefaultencoding("utf-8")


def ordd(str):
    t = ord(str)
    #65到90是A到Z
    if(t>90):
        return t-32
    else:
        return t


def typeme(passw):
    psht = len(passw)
    for j in range(psht):
        win32api.keybd_event(ordd(passw[j]), 0, 0, 0)
        time.sleep(0.5)
        win32api.keybd_event(ordd(passw[j]), 0, win32con.KEYEVENTF_KEYUP, 0)
        time.sleep(0.5)

time.sleep(3)
userpass = "jhf123"
'''
print 't'
print ordd('t')
print chr(116)

print 'a'
print ordd('a')
print chr(97)

time.sleep(1)
#print '\n\t'
'''


'''
#65到90是A到Z
win32api.keybd_event(ordd('t'), 0, 0, 0)
win32api.keybd_event(ordd('t'), 0, win32con.KEYEVENTF_KEYUP, 0)
win32api.keybd_event(ordd('q'), 0, 0, 0)
win32api.keybd_event(ordd('q'), 0, win32con.KEYEVENTF_KEYUP, 0)

win32api.keybd_event(ordd('3'), 0, 0, 0)
win32api.keybd_event(ordd('3'), 0, win32con.KEYEVENTF_KEYUP, 0)
win32api.keybd_event(ordd('j'), 0, 0, 0)
win32api.keybd_event(ordd('j'), 0, win32con.KEYEVENTF_KEYUP, 0)
win32api.keybd_event(ordd('x'), 0, 0, 0)
win32api.keybd_event(ordd('x'), 0, win32con.KEYEVENTF_KEYUP, 0)
win32api.keybd_event(ordd('8'), 0, 0, 0)
win32api.keybd_event(ordd('8'), 0, win32con.KEYEVENTF_KEYUP, 0)
'''

#typeme(userpass)

def jumpIEtab():
    win32api.keybd_event(ordd('8'), 0, 0, 0)
    win32api.keybd_event(ordd('8'), 0, win32con.KEYEVENTF_KEYUP, 0)
    win32api.keybd_event(ordd('8'), 0, 0, 0)
    win32api.keybd_event(ordd('8'), 0, win32con.KEYEVENTF_KEYUP, 0)
